home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / Asap / ASAP / IORequest.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-09  |  3.0 KB  |  94 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AIORequest wrapper class                                                  *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_IORequest_H
  12. #define ASAP_IORequest_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <CLIB/ALIB_PROTOS.h>
  19.  #include <Proto/EXEC.h>
  20. }
  21.  
  22. class AIORequest : public IORequest
  23. {
  24.  public:
  25.  inline void AbortIO();
  26.  inline void BeginIO();
  27.  inline AIORequest * CheckIO();
  28.  inline void CloseDevice();
  29.  inline static AIORequest * CreateExtIO(MsgPort * port, long ioSize);
  30.  inline void * operator new(size_t, MsgPort * port, long ioSize);
  31.  inline void DeleteExtIO();
  32.  inline void operator delete(void *);
  33.  inline BYTE DoIO();
  34.  inline void SendIO();
  35.  inline BYTE WaitIO();
  36. };
  37. //----------------------------------------------------------------------------
  38. void AIORequest::AbortIO ()
  39. {
  40.  ::AbortIO(this);
  41. }
  42. //----------------------------------------------------------------------------
  43. void AIORequest::BeginIO ()
  44. {
  45.  ::BeginIO(this);
  46. }
  47. //----------------------------------------------------------------------------
  48. AIORequest * AIORequest::CheckIO ()
  49. {
  50.  return (AIORequest *) ::CheckIO(this);
  51. }
  52. //----------------------------------------------------------------------------
  53. void AIORequest::CloseDevice ()
  54. {
  55.  ::CloseDevice(this);
  56. }
  57. //----------------------------------------------------------------------------
  58. AIORequest * AIORequest::CreateExtIO (struct MsgPort * port, long ioSize)
  59. {
  60.  return (AIORequest *) ::CreateExtIO(port, ioSize);
  61. }
  62. //----------------------------------------------------------------------------
  63. void * operator new (size_t, MsgPort * port, long ioSize)
  64. {
  65.  return AIORequest::CreateExtIO(port, ioSize);
  66. }
  67. //----------------------------------------------------------------------------
  68. void AIORequest::DeleteExtIO ()
  69. {
  70.  ::DeleteExtIO(this);
  71. }
  72. //----------------------------------------------------------------------------
  73. void AIORequest::operator delete (void *extIO)
  74. {
  75.  ((AIORequest *) extIO)->DeleteExtIO();
  76. }
  77. //----------------------------------------------------------------------------
  78. BYTE AIORequest::DoIO ()
  79. {
  80.  return ::DoIO(this);
  81. }
  82. //----------------------------------------------------------------------------
  83. void AIORequest::SendIO ()
  84. {
  85.  ::SendIO(this);
  86. }
  87. //----------------------------------------------------------------------------
  88. BYTE AIORequest::WaitIO ()
  89. {
  90.  return ::WaitIO(this);
  91. }
  92.  
  93. #endif
  94.